# 961 简单：在长度2N的数组中找出重复N次的元素

def repeatedNTimes(nums):
    s = set()
    for num in nums:
        if s.__contains__(num):
        # if num in s:
            return num
        s.add(num)
    return -1


repeatedNTimes([1, 2, 2])
